#!/usr/bin/env python

import socket
import sys
import SOAPpy as soap

socket.setdefaulttimeout(3.0)
key, user, password = sys.argv[1:4]
server = soap.SOAPProxy("https://ae.utbm.fr/apisso.php")
try:
    uid = int(server.testLogin(apikey=key, login=user, password=password))
except:
    print 'Error contacting SSO server'
else:
    if uid > 0:
        print 'true'
    else:
        print 'false'
